class Bank {

private:
    int n;
    vector<long long> m_vecArr;
public:
    Bank(vector<long long>& balance) {

        n=balance.size();
        m_vecArr.resize(n+1);
        for(int i=1;i<=n;++i){
            m_vecArr[i]=balance[i-1];
        }
    }
    
    bool transfer(int account1, int account2, long long money) {
        
        if(account1<1 || account1>n || account2<1 || account2>n || m_vecArr[account1]<money){
            return false;
        }
        m_vecArr[account1]-=money;
        m_vecArr[account2]+=money;

        return true;
    }
    
    bool deposit(int account, long long money) {
        
        if(account>n || account<1){
            return false;
        }
        m_vecArr[account]+=money;

        return true;
    }
    
    bool withdraw(int account, long long money) {
        
        if(account>n || account<1 || m_vecArr[account]<money){
            return false;
        }
        m_vecArr[account]-=money;

        return true;
    }
};

/**
 * Your Bank object will be instantiated and called as such:
 * Bank* obj = new Bank(balance);
 * bool param_1 = obj->transfer(account1,account2,money);
 * bool param_2 = obj->deposit(account,money);
 * bool param_3 = obj->withdraw(account,money);
 */
